package myblog.action;

import java.util.ArrayList;
import java.util.List;

import myblog.service.UserService;
import myblog.vo.UsersVo;


import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport {

	private UserService service;

	private List<UsersVo> userList = new ArrayList<UsersVo>();

	private UsersVo user = null;

	private String userid;
	
	public String list() {

		userList = service.list();

		return "list";
	}


	public String add() {

		service.addUser(user);

		return "list";
	}
	public String findlogBylogid() {

		user = service.getuser(userid);

		return "update";
	}

	public String update() {

		service.editUser(user);

		return "list";
	}

	public void setService(UserService service) {
		this.service = service;
	}

	public List<UsersVo> getuserList() {
		return userList;
	}

	public void setuserList(List<UsersVo> userList) {
		this.userList = userList;
	}

	public UsersVo getuser() {
		return user;
	}

	public void setuser(UsersVo user) {
		this.user = user;
	}

	public String getuserid() {
		return userid;
	}

	public void setuserid(String userid) {
		this.userid = userid;
	}


}
